import { Match3ZiUE } from "./Match3ZiUE";
export class ZiStack{

    //用数组实现栈
    private m_Stack:Match3ZiUE[] = [];

    get empty():boolean{return this.m_Stack.length === 0};

    //获取栈顶元素
    get top():Match3ZiUE | null{
        if(this.empty){
            return null;
        }
        return  this.m_Stack[this.m_Stack.length -1];
    }

    push(zi:Match3ZiUE){
        this.m_Stack.push(zi);
    }

    pop(){
        return this.m_Stack.pop();
    }
}